import { BasicColumn, FormSchema } from '@apps/antd-admin/src/components/Table';
import {render} from "@apps/antd-admin/src/hooks/render/renderUtils";
import {RenderType} from '@pkg/setting';
export const columns: BasicColumn[] = [
  {
    title: '内容',
    dataIndex: 'feedContent',
    width: 180,
    customRender: render.renderTxt,
  },
  {
    title: '用户名',
    dataIndex: 'userName',
    width: 100,
  },
  {
    title: '手机号',
    dataIndex: 'mobile',
    width: 100,
  },
  {
    title: '邮箱',
    dataIndex: 'email',
    width: 100,
  },
  {
    title: '航班号',
    dataIndex: 'feedTags',
    width: 100,
  },
  {
    title: '图片',
    dataIndex: 'feedImages',
    width: 70,
    customRender: render.renderImage,
  },
  {
    title: '状态',
    dataIndex: 'feedState',
    width: 120,
    dictCode:'feedState',
    renderType:RenderType.DICT
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 150,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'content',
    label: '标题',
    component: 'Input',
    colProps: { span: 4 },
  },{
    field: 'userName',
    label: '用户名',
    component: 'Input',
    colProps: { span: 4 },
  },{
    field: 'mobile',
    label: '手机号',
    component: 'Input',
    colProps: { span: 4 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '内容',
    field: 'feedContent',
    component: 'InputTextArea',
    dynamicDisabled: true,
    required: true,
  },
  {
    label: '图片',
    field: 'feedImages',
    dynamicDisabled: true,
    ifShow: ({ values }) => {
      return values.feedImages != '';
    },
    component: 'ImageUpload',
  },
  {
    label: '回复内容',
    field: 'replyContent',
    component: 'InputTextArea',
    required: true,
  },
];
